import spuApi from '@/api/spu'
const state = {
    total: 0,
    spuPageList:[]
}
const mutations = {
    SET_TOTAL(state,total) {
        state.total = total
    },
    SET_SPUPAGELIST(state, spuPageList) {
        state.spuPageList = spuPageList
    }
}
const actions = {
    async getSpuPageList({ commit }, { page, limit, category3Id }) {
        const res = await spuApi.getSpuPageList(page, limit, category3Id)
        commit('SET_TOTAL', res.data.total)
        commit('SET_SPUPAGELIST',res.data.records)
    }
}
const getters = {}
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}